Skip to content

Conversation

mingulee-devel
Copy link

์•ˆ๋…•ํ•˜์„ธ์š”! ์ •๋ง ์˜ค๋žœ๋งŒ์— PR ๋“œ๋ฆฝ๋‹ˆ๋‹ค...
์ง€๊ธˆ๋„ ๋ฆฌ๋ทฐ๋ฅผ ์ง„ํ–‰ํ•˜์‹œ๋Š”์ง€ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ ํ•œ๋ฒˆ ์˜ฌ๋ ค๋ด…๋‹ˆ๋‹ค!

๊ตฌํ˜„ํ•˜๋ฉด์„œ ๊ถ๊ธˆํ–ˆ๋˜ ๋ถ€๋ถ„์— ๋Œ€ํ•ด ์งˆ๋ฌธ ๋‚จ๊ฒจ๋ด…๋‹ˆ๋‹ค!

  1. ResultView์—์„œ
    getAllResult์— ์‚ฌ๋žŒ ์ˆ˜๋งŒํผ ๋ฐ˜๋ณต์ด ํ•„์š”ํ•œ๋ฐ, crossSize ํ˜น์€ countOfPerson์„ ๋„˜๊ฒจ์ฃผ๋Š” ๊ฒƒ์€ ๋ถˆํ•„์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ
    ์•„๋ž˜์™€ ๊ฐ™์ด lines.get(0).getCrossSize()๋กœ ์ž‘์„ฑํ•˜์˜€์Šต๋‹ˆ๋‹ค.
    ์ด๋Ÿฌํ•œ ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„์„ ํ•ด๋„ ๋˜๋Š”์ง€, ๋” ์ข‹์€ ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!
  public Map<Integer, Integer> getAllResult() {
      return IntStream.range(0, lines.get(0).getCrossSize())
              .boxed()
              .collect(Collectors.toMap(i -> i, i -> move(i)));
  }
  1. ๋ฆฌํŒฉํ† ๋ง์„ ์ง„ํ–‰ํ•  ๋•Œ ๋“ค์—ˆ๋˜ ๊ฐ•์˜์—์„œ Line ํด๋ž˜์Šค์— ์•„๋ž˜์™€ ๊ฐ™์ด move๊ฐ€ ๊ตฌํ˜„๋˜์–ด์žˆ์–ด์„œ
    public int move(int position) {
        return this.crosses.get(position).move();
    }

Usernames์—์„œ username์„ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ์ธ๋ฑ์Šค๋ฅผ ๋„˜๊ฒจ๋ฐ›์•„ ๋‚ด๋ถ€ username์„ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ๋ฉ”์„œ๋“œ๋ฅผ ์ถ”๊ฐ€ ๊ตฌํ˜„ํ•˜์˜€๋Š”๋ฐ ์ด๋ ‡๊ฒŒ ํ•ด๋„ ๊ดœ์ฐฎ์€์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค.

public String getUsername(int index) {
        return usernames.get(index).getUsername();
    }
  1. ๋กœ๋˜๊นŒ์ง€ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์„ ๋ถ„๋ฆฌํ•  ๋•Œ ํ•ญ์ƒ ๋„๋ฉ”์ธ๋ช…s๋ฅผ ๋ถ™์˜€๋Š”๋ฐ,
    ๊ตฌํ˜„๋œ ๋‚ด์šฉ์—์„œ Line์—๋Š” List๋งŒ ์กด์žฌํ•˜๊ณ , Ladder์—๋Š” List๋งŒ ์กด์žฌํ•œ๋‹ค๋ฉด
    Line์ด Cross์˜ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜, Ladder๊ฐ€ Line์˜ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์ด๋ผ๊ณ  ๋ณด๋ฉด ๋˜๋Š” ๊ฑธ๊นŒ์š”?

๊ฐ•์˜๋ฅผ ๋“ค์œผ๋ฉด์„œ ๋‚ด๋ถ€ ๊ฐ์ฒด๋ฅผ ๊บผ๋‚ด์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์€ ์ตœ๋Œ€ํ•œ ์ง€์–‘ํ•ด์•ผํ•˜๊ณ  List๊ฐ€ ์กด์žฌํ•  ๋•Œ ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์œผ๋กœ ๋ถ„๋ฆฌํ•ด์•ผ๋œ๋‹ค๋Š” ๋‚ด์šฉ์„ ๋ฐฐ์› ๋Š”๋ฐ, ์ œ๊ฐ€ ์—ฌ๊ธฐ์—๋งŒ ๋„ˆ๋ฌด ์‹ ๊ฒฝ์„ ์“ฐ๋Š” ๊ฑด์ง€ ์œ„์— ์งˆ๋ฌธ ๋“œ๋ฆฐ get(~)์ด๋‚˜ List๋งŒ ๋ณด๋ฉด ๋งˆ์Œ์ด ๋ถˆํŽธํ•ฉ๋‹ˆ๋‹ค ใ… ใ… 
์•„์ง ํŒ๋‹จ ๊ธฐ์ค€์ด ๋ช…ํ™•ํ•˜์ง€ ์•Š์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค...

๋ฐ”์˜์‹  ์™€์ค‘์— ์งˆ๋ฌธ์ด ๋งŽ์•„ ์†ก๊ตฌ์Šค๋Ÿฌ์šด ๋งˆ์Œ์ž…๋‹ˆ๋‹ค
์ˆ˜๊ฐ•์‹ ์ฒญ ๋ฏธ์…˜๋„ ์ตœ๋Œ€ํ•œ ๋น ๋ฅด๊ฒŒ ์ง„ํ–‰ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค...
์˜ค๋Š˜๋„ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ˜„

-- ๊ฒฐ๊ณผ๊ฐ’ ์˜ค๋ฅ˜ ์ˆ˜์ • ํ•„์š”ํ•จ

Ladder2
-- getAllResult lines.get(0).getCrossSize()

Usernames
-- getUsername
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant